﻿@using ZBJF.Warranty.BLL
@using ZBJF.Warranty.Common.Enums.InsuranceWarranty
@using ZBJF.Warranty.Common.Enums.System
@model ZBJF.Warranty.Model.InsuranceWarrantyRecord
@{
    var insuranceOrderFeedbackHistory = ServiceFactory.InsuranceWarrantyRecordFeedBackIussesServiceInstance.LoadList(Model.ID).ToList();
}
<h4>历史工单问题</h4>
<table class="table table-responsive table-bordered table-hover">
    <tr>
        <th>序号</th>
        <th>问题描述</th>
        <th>问题附件</th>
        <th>提出人</th>
        <th>解决人</th>
        <th>解决结果</th>
    </tr>
    @for (int i = 0; i < insuranceOrderFeedbackHistory.Count; i++)
    {
        var item = insuranceOrderFeedbackHistory[i];
        var uploadFiles = ServiceFactory.UploadFilesServiceInstance.GetFiles(NeedUploadFileDataTableEnums.InsuranceWarrantyRecordFeedBackIusses, item.ID);
        var imageUrls = uploadFiles.Any() ? uploadFiles.Select(o => o.FilePath).ToList().Aggregate(string.Empty, (c, d) => c + ';' + d).Trim(';') : "";
        <tr>
            <td>@(i + 1)</td>
            <td>
                @item.IssueDesc
            </td>
            <td>
                @if (uploadFiles.Any())
                {
                    <a class='Edit-R' href='javascript:void(0);' onclick="showImageLayer(this, 'MultiImageLook.html')" imgurl="@(imageUrls)">
                        查看附件
                    </a>
                }
            </td>
            <td>
                @item.CreatedBy
            </td>
            <td>
                @item.SolveWith
            </td>
            <td>
                @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(FeedbackIssueStatus), item.Status)
            </td>
        </tr>
    }
</table>